Ext.define('Admin.view.role.RoleGridPanel', {
    extend: 'Ext.grid.Panel',
    xtype: 'roleGridPanel',
    id:'roleGridPanel',
      
    requires: [
      //'Ext.grid.column.RowNumberer',
      'Ext.selection.CheckboxModel'
    ],
    title: '用户列表',
    //store: Ext.data.StoreManager.lookup('simpsonsStore'),
  bind: '{roleDataList}',
  selModel: {
    selType: 'checkboxmodel',
        checkOnly: true,
        showHeaderCheckbox: true
    },
    //multiSelect: true,
     dockedItems: [{
        xtype: 'toolbar',
        items: [{
            xtype: 'textfield',
            name:'searchFieldValue',
            reference:'searchFieldValue',
            width:400
        },'-',{
            text:'查询',
            tooltip:'查询',
            iconCls:'x-fa fa-search',
            handler : 'search'
        },'-',{
            text:'增加角色',
            tooltip:'增加角色',
            iconCls:'x-fa fa-plus',
            handler : 'openAddWindow'
        },'-',{
            text:'Delete',
            tooltip:'批量删除',
            iconCls:'x-fa fa-trash-o',
            handler : 'deleteRoles'
        }]
    }],
    columns: [
        //{xtype: 'rownumberer',width: 40, sortable: false},
         { header: '角色名称',  dataIndex: 'roleName',width:400 },
         { header: '角色类型',  dataIndex: 'roleType',width:400 },
        {
            xtype: 'actioncolumn',
            items: [{
            xtype: 'button',
            iconCls: 'x-fa fa-pencil',
            tooltip:'编辑',
            handler : 'openEditWindow'
            },{
                xtype: 'button',
                iconCls: 'x-fa fa-trash',
                tooltip:'删除',
                handler : 'deleteRole'
            }],
            cls: 'content-column',
            flex: 1 ,
            //dataIndex: 'bool',
            text: '操作',
            tooltip: '操作 '
          }
     
    ],
    columnLines: true,
  bbar: {
      xtype: 'pagingtoolbar',//注意以后MVVM中使用新写法,不要使用Ext.create()
        //store: Ext.data.StoreManager.lookup('simpsonsStore'),
        bind: '{roleDataList}',
        displayInfo: true,
        displayMsg: 'Displaying topics {0} - {1} of {2}',
        emptyMsg: "No topics to display"
    }
});